<?php require RCMS_Object_QuickConfig_QuickConfig::PATH_HEADER; ?>
<?php $this->headLink()->appendStylesheet($this->websiteUrl . 'system/css/seotoaster.css'); ?>
<?php echo $this->headLink(); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/jquery/jquery.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/system.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/promote/promote.js'); ?>
<?php echo $this->headScript(); ?>
<script type="text/javascript">
$(document).ready(function() {
    $("#form-add-service").submit(function() {
        var id = $("#form-add-service-id").val();
        if (/^([0-9]{1,10})$/.test(id) && id == 0) {
            addService();
        }
        if (/^([0-9]{1,10})$/.test(id) && id > 0) {
            updateService();
        }
    });
});
</script>
<div id="seotoaster" class="promote">
    <div class="admineditwhat">{%Promote%}</div>
	<div class="close_window" onclick="parent.tb_remove();"></div>
    <div class="success" style="display:none;"></div>
    <div class="showsitemap" align="center">
        <div>{%SiteMap%}: <a href="<?php echo $this->websiteUrl; ?>sitemap.xml" target="_blank"><?php echo $this->websiteUrl; ?>sitemap.xml</a></div>
    </div>
    <fieldset style="position:relative">
        <legend>{%BlogPost Marketing%}:</legend>
        <p>{%Ping following blog directories%}:</p>
        <form action="javascript:;" id="form-add-service" name="form-add-service">
            <input type="text" id="add-service" name="add-service" value="http://" size="30">
            <input type="hidden" id="website" name="website" value="<?php echo $this->websiteUrl; ?>">
            <input type="hidden" id="form-add-service-id" name="form-add-service-id" value="0">
            <button class="formsubmit" style="width:100px;">{%Add%}</button>
        </form>
        <div class="pingbloglist">
            <?php if (is_array($this->services) && count($this->services) > 0): ?>
            <?php foreach ($this->services as $service): ?>
            <div id="service-<?php echo $service['id']; ?>" class="service">
                <div class="service-url"><span title="<?php echo $service['url']; ?>"><?php echo strlen($service['url']) < 50 ? $service['url'] : substr($service['url'],0,50).'...' ; ?></span></div>
                <div class="service-edit"><?php if (!in_array($service['url'], array('http://blogsearch.google.com/ping/RPC2','http://rpc.pingomatic.com/'))): ?><a href="#" onclick="editService(<?php echo $service['id']; ?>);return false;">edit</a><?php else: ?>&nbsp;<?php endif; ?></div>
                <div class="service-delete"><?php if (!in_array($service['url'], array('http://blogsearch.google.com/ping/RPC2','http://rpc.pingomatic.com/'))): ?><a href="#" onclick="deleteSevice(<?php echo $service['id']; ?>);return false;">delete</a><?php else: ?>&nbsp;<?php endif; ?></div>
            </div>
            <?php endforeach; ?>
            <?php endif; ?>            
        </div>
    </fieldset>    
</div>